﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using LYM.CommonWeb;
using LYM.CommonWeb.DataServer;

namespace DAL
{
    public class TestDataDAL
    {
        private static readonly string connectionStr = ConfigHelper.GetConnectionString("testCache");
        static TestDataDAL dal = null;

        private TestDataDAL()
        {
        }
        static object locker = new object();
        /// <summary>
        /// 获取对象
        /// </summary>
        /// <returns></returns>
        public static TestDataDAL GetTestDataDAL()
        {
            if (dal == null)
            {
                lock (locker)
                {
                    if (dal == null)
                    {
                        dal = new TestDataDAL();
                    }
                }
            }
            return dal;
        }

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <returns></returns>
        public DataSet GetData()
        {
            return SqlHelper.ExecuteGetDataSet(connectionStr, CommandType.Text, "select * from CacheTable order by price");
        }
    }
}
